#!/usr/bin/python
# Copyright (C) 2007 by Og Maciel <og.maciel@gmail.com>
#
# Provided under MIT licence, please see included
# COPYRIGHT and/or COPYING file.

import sys
args = sys.argv

if "--notifier" in args:
    import billreminder.notifier
elif "--stop" in args:
    import os
    import gobject
    import dbus
    try:
        session_bus = dbus.SessionBus()
        obj = session_bus.get_object("org.gnome.Billreminder.Daemon", "/org/gnome/Billreminder/Daemon")
        interface = dbus.Interface(obj, "org.gnome.Billreminder.Daemon")
        print "Stopping BillReminder Daemon..."
        interface.quit()
    except:
        print "No BillReminder Daemon is running."

else:
    import billreminder.startup
